<?php

/* html/diary/rijiDP.tpl.html */
class __TwigTemplate_791376517564f846daa02da22c878db99d7a1c0c261cce135d56c7785961cf95 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<!DOCTYPE html>
<html lang=\"zh\">

<head>
\t<title>本期活动</title>
\t<meta charset=\"utf-8\">
\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\">
\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/diary/css/rijiDP.css\">
\t<link rel=\"stylesheet\" href=\"/static/common/css/mescroll.min.css\">
</head>

<body>

\t<!-- top -->
\t<!--<header id=\"top\">
\t\t<img src=\"/static/diary/assets/arrow.png\">本期活动
\t</header>-->
\t<section id=\"main\">
\t\t<div class='logo'>
\t\t\t<img v-bind:src=\"topic_logo\" class=\"banner\">
\t\t\t<div id=\"huati\">
\t\t\t\t<div class=\"huati_t\">
\t\t\t\t\t<h3>话题：[topic_title]</h3>
\t\t\t\t\t<p><img src=\"/static/diary/assets/Group 9.png\"><span>[topic_sum_comment]条点评</span></p>
\t\t\t\t</div>
\t\t\t\t<p class=\"gaishu\">[topic_content]</p>
\t\t\t\t<p class=\"mingz\">编辑 | <span>[editor]</span></p>
\t\t\t\t<p class=\"time\">TIME | 09.08.2017</p>
\t\t\t</div>
\t\t</div>
\t\t<!-- 妈妈日记精选 -->
\t\t<div id=\"rijiJX\" class=\"mescroll\">
\t\t\t<p class=\"ceshi\">妈妈日记精选</p>
\t\t\t<div class=\"rijiJX_b\">
\t\t\t\t<div class=\"rijiJX_k\" v-for=\"(item,index) in rijiList\">
\t\t\t\t\t<div class=\"touxiang\">
\t\t\t\t\t\t<label class=\"tou\"></label><span>[item.editor_name]</span>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"rijiJX_k_tu\" onclick='aHref(this)' v-bind:attr_id='item.id'>
\t\t\t\t\t\t<img v-bind:src=\"item.diary_logo\">
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"rijiJX_k_zan\">
\t\t\t\t\t\t<div class=\"yan\"><span class=\"di\">12</span>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div   @click='zan(index)' :class='{dianzan: !item.zan,liangdianzan: item.zan}' ><span class=\"di\">[item.zan_num]</span>
\t\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t</div>
\t</section>
</body>
<script type=\"text/javascript\" src=\"/static/common/js/zepto.js\"></script>
<script type=\"text/ja'vascript\" src=\"/static/diary/js/rijiZW.js\"></script>
<script src=\"/static/common/js/mescroll.min.js\"></script>
<script type=\"text/javascript\" src=\"/static/common/js/vue.js\"></script>
<script type=\"text/javascript\">
\tvar gid = ";
        // line 58
        echo twig_escape_filter($this->env, ($context["gid"] ?? null), "html", null, true);
        echo ";
\t(function () {
\t\t// 接口
\t\tvar Api = {
\t\t\tbase: 'https://paile.yanfaguanjia.cn',
\t\t\triji: '/diary/GetLeftComment',
\t\t\trijiList: '/diary/GetRecomDiary',
\t\t\tdianzan: '/diary/AgreeZan',
\t\t\thuati: '/diary/GetActivityDetail'
\t\t}

\t\t// 获取日记列表数据的ajax方法
\t\tfunction getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
\t\t\t\$.ajax({
\t\t\t\turl: Api.base + Api.rijiList,
\t\t\t\tdata: {
\t\t\t\t\tperiod: gid,
\t\t\t\t\tpage: pageNum,
\t\t\t\t\tnum: pageSize
\t\t\t\t},
\t\t\t\ttype: 'post',
\t\t\t\tdataType: 'json',
\t\t\t\tsuccess: function (res) {
\t\t\t\t\tsuccessCallback && successCallback(res.data)
\t\t\t\t},
\t\t\t\terror: function (xhr, state, err) {
\t\t\t\t\tif (errorCallback) {
\t\t\t\t\t\terrorCallback(err)
\t\t\t\t\t} else {
\t\t\t\t\t\tconsole.log('获取日记列表数据失败', err)
\t\t\t\t\t}
\t\t\t\t}
\t\t\t})
\t\t}

\t\t// 日记精选
\t\tvar rijiJX = new Vue({
\t\t\tel: '#rijiJX',
\t\t\tdelimiters: ['[', ']'],
\t\t\tdata: {
\t\t\t\tmescroll: null,
\t\t\t\trijiList: []
\t\t\t},
\t\t\tmounted: function () {
\t\t\t\tvar self = this;
\t\t\t\tself.mescroll = new MeScroll('rijiJX', {
\t\t\t\t\tup: {
\t\t\t\t\t\tcallback: self.upCallback,
\t\t\t\t\t\tpage: {
\t\t\t\t\t\t\tsize: 5
\t\t\t\t\t\t}
\t\t\t\t\t},
\t\t\t\t\t// 锁定上拉恢复
\t\t\t\t\tdown: {
\t\t\t\t\t\tisLock: true
\t\t\t\t\t}
\t\t\t\t});

\t\t\t},
\t\t\tmethods: {
\t\t\t\tupCallback(page) {
\t\t\t\t\tvar self = this;

\t\t\t\t\t//console.log('page.num=', page.num, 'page.size=', page.size)

\t\t\t\t\tgetListDataFromNet(page.num, page.size, function (data) {
\t\t\t\t\t\t// console.log('获取数据成功: page.num = ', page.num, 'page.size = ', page.size, 'diata is ', data)
\t\t\t\t\t\tif (page.num == 1) self.rijiList = [];
\t\t\t\t\t\tvar datas = data;
\t\t\t\t\t\tfor(var i=0; i<datas.length; i++){
\t\t\t\t\t\t\tdatas[i].zan = false;
\t\t\t\t\t\t}
\t\t\t\t\t\tself.rijiList = self.rijiList.concat(datas)

\t\t\t\t\t\tself.mescroll.endSuccess(datas.length);
\t\t\t\t\t}, function (err) {
\t\t\t\t\t\tconsole.log('获取数据失败', err)
\t\t\t\t\t})
\t\t\t\t},
\t\t\t\t// 点赞效果
\t\t\t\tzan(index){
\t\t\t\t\tthis.rijiList[index].zan = !this.rijiList[index].zan;
\t\t\t\t\tif(this.rijiList[index].zan == false){
\t\t\t\t\t \tthis.rijiList[index].zan_num --;
\t\t\t\t\t \t//  获取点赞接口数据
\t\t\t\t\t\t\$.ajax({
\t\t\t\t\t\t\ttype: \"post\",
\t\t\t\t\t\t\turl: Api.base +Api.dianzan,
\t\t\t\t\t\t\tdata:{
\t\t\t\t\t\t\t\tdid:1
\t\t\t\t\t\t\t},
\t\t\t\t\t\t\tdataType: \"json\",
\t\t\t\t\t\t\tsuccess: function (data) {
\t\t\t\t\t\t\t\tconsole.log(data);
\t\t\t\t\t\t\t},
\t\t\t\t\t\t\terror: function (data) {
\t\t\t\t\t  \t\t    console.log(data);\t
\t\t\t\t\t\t\t}
\t\t\t\t\t\t});
\t\t\t\t\t}else{
\t\t\t\t\t\tthis.rijiList[index].zan_num ++;
\t\t\t\t\t}\t
\t\t\t\t}
\t\t\t}
\t\t})
\t
\t\t// 获取话题接口数据
\t\t\$.ajax({
\t\t\turl: Api.base + Api.huati,
\t\t\ttype: 'post',
\t\t\tdata:{
\t\t\t\tperiod:1
\t\t\t},
\t\t\tdataType: 'json',
\t\t\tsuccess: function (data) {
\t\t\t\tconsole.log(data.data);
\t\t\t\tvar topic_content = data.data.topic_content;
\t\t\t\tvar topic_sum_comment = data.data.topic_sum_comment;
\t\t\t\tvar topic_title = data.data.topic_title
\t\t\t\tvar editor = data.data.editor;
\t\t\t\tvar topic_logo = data.data.topic_logo;
\t\t\t\tnew Vue({
\t\t\t\t\tel: '.logo',
\t\t\t\t\tdelimiters: ['[', ']'],
\t\t\t\t\tdata: {
\t\t\t\t\t\ttopic_content: topic_content,
\t\t\t\t\t\ttopic_sum_comment: topic_sum_comment,
\t\t\t\t\t\ttopic_title: topic_title,
\t\t\t\t\t\teditor: editor,
\t\t\t\t\t\ttopic_logo: topic_logo
\t\t\t\t\t}
\t\t\t\t})

\t\t\t},
\t\t\terror: function () {
\t\t\t   console.log('获取日记列表数据失败')\t
\t\t\t}
\t\t})

\t

\t})()
function aHref(obj){
\twindow.location.href = '/diary/rijiZW.html?gid='+\$(obj).attr('attr_id');
}\t
</script>
</html>
";
    }

    public function getTemplateName()
    {
        return "html/diary/rijiDP.tpl.html";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  78 => 58,  19 => 1,);
    }

    public function getSourceContext()
    {
        return new Twig_Source("<!DOCTYPE html>
<html lang=\"zh\">

<head>
\t<title>本期活动</title>
\t<meta charset=\"utf-8\">
\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\">
\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/diary/css/rijiDP.css\">
\t<link rel=\"stylesheet\" href=\"/static/common/css/mescroll.min.css\">
</head>

<body>

\t<!-- top -->
\t<!--<header id=\"top\">
\t\t<img src=\"/static/diary/assets/arrow.png\">本期活动
\t</header>-->
\t<section id=\"main\">
\t\t<div class='logo'>
\t\t\t<img v-bind:src=\"topic_logo\" class=\"banner\">
\t\t\t<div id=\"huati\">
\t\t\t\t<div class=\"huati_t\">
\t\t\t\t\t<h3>话题：[topic_title]</h3>
\t\t\t\t\t<p><img src=\"/static/diary/assets/Group 9.png\"><span>[topic_sum_comment]条点评</span></p>
\t\t\t\t</div>
\t\t\t\t<p class=\"gaishu\">[topic_content]</p>
\t\t\t\t<p class=\"mingz\">编辑 | <span>[editor]</span></p>
\t\t\t\t<p class=\"time\">TIME | 09.08.2017</p>
\t\t\t</div>
\t\t</div>
\t\t<!-- 妈妈日记精选 -->
\t\t<div id=\"rijiJX\" class=\"mescroll\">
\t\t\t<p class=\"ceshi\">妈妈日记精选</p>
\t\t\t<div class=\"rijiJX_b\">
\t\t\t\t<div class=\"rijiJX_k\" v-for=\"(item,index) in rijiList\">
\t\t\t\t\t<div class=\"touxiang\">
\t\t\t\t\t\t<label class=\"tou\"></label><span>[item.editor_name]</span>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"rijiJX_k_tu\" onclick='aHref(this)' v-bind:attr_id='item.id'>
\t\t\t\t\t\t<img v-bind:src=\"item.diary_logo\">
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"rijiJX_k_zan\">
\t\t\t\t\t\t<div class=\"yan\"><span class=\"di\">12</span>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div   @click='zan(index)' :class='{dianzan: !item.zan,liangdianzan: item.zan}' ><span class=\"di\">[item.zan_num]</span>
\t\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t</div>
\t</section>
</body>
<script type=\"text/javascript\" src=\"/static/common/js/zepto.js\"></script>
<script type=\"text/ja'vascript\" src=\"/static/diary/js/rijiZW.js\"></script>
<script src=\"/static/common/js/mescroll.min.js\"></script>
<script type=\"text/javascript\" src=\"/static/common/js/vue.js\"></script>
<script type=\"text/javascript\">
\tvar gid = {{gid}};
\t(function () {
\t\t// 接口
\t\tvar Api = {
\t\t\tbase: 'https://paile.yanfaguanjia.cn',
\t\t\triji: '/diary/GetLeftComment',
\t\t\trijiList: '/diary/GetRecomDiary',
\t\t\tdianzan: '/diary/AgreeZan',
\t\t\thuati: '/diary/GetActivityDetail'
\t\t}

\t\t// 获取日记列表数据的ajax方法
\t\tfunction getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
\t\t\t\$.ajax({
\t\t\t\turl: Api.base + Api.rijiList,
\t\t\t\tdata: {
\t\t\t\t\tperiod: gid,
\t\t\t\t\tpage: pageNum,
\t\t\t\t\tnum: pageSize
\t\t\t\t},
\t\t\t\ttype: 'post',
\t\t\t\tdataType: 'json',
\t\t\t\tsuccess: function (res) {
\t\t\t\t\tsuccessCallback && successCallback(res.data)
\t\t\t\t},
\t\t\t\terror: function (xhr, state, err) {
\t\t\t\t\tif (errorCallback) {
\t\t\t\t\t\terrorCallback(err)
\t\t\t\t\t} else {
\t\t\t\t\t\tconsole.log('获取日记列表数据失败', err)
\t\t\t\t\t}
\t\t\t\t}
\t\t\t})
\t\t}

\t\t// 日记精选
\t\tvar rijiJX = new Vue({
\t\t\tel: '#rijiJX',
\t\t\tdelimiters: ['[', ']'],
\t\t\tdata: {
\t\t\t\tmescroll: null,
\t\t\t\trijiList: []
\t\t\t},
\t\t\tmounted: function () {
\t\t\t\tvar self = this;
\t\t\t\tself.mescroll = new MeScroll('rijiJX', {
\t\t\t\t\tup: {
\t\t\t\t\t\tcallback: self.upCallback,
\t\t\t\t\t\tpage: {
\t\t\t\t\t\t\tsize: 5
\t\t\t\t\t\t}
\t\t\t\t\t},
\t\t\t\t\t// 锁定上拉恢复
\t\t\t\t\tdown: {
\t\t\t\t\t\tisLock: true
\t\t\t\t\t}
\t\t\t\t});

\t\t\t},
\t\t\tmethods: {
\t\t\t\tupCallback(page) {
\t\t\t\t\tvar self = this;

\t\t\t\t\t//console.log('page.num=', page.num, 'page.size=', page.size)

\t\t\t\t\tgetListDataFromNet(page.num, page.size, function (data) {
\t\t\t\t\t\t// console.log('获取数据成功: page.num = ', page.num, 'page.size = ', page.size, 'diata is ', data)
\t\t\t\t\t\tif (page.num == 1) self.rijiList = [];
\t\t\t\t\t\tvar datas = data;
\t\t\t\t\t\tfor(var i=0; i<datas.length; i++){
\t\t\t\t\t\t\tdatas[i].zan = false;
\t\t\t\t\t\t}
\t\t\t\t\t\tself.rijiList = self.rijiList.concat(datas)

\t\t\t\t\t\tself.mescroll.endSuccess(datas.length);
\t\t\t\t\t}, function (err) {
\t\t\t\t\t\tconsole.log('获取数据失败', err)
\t\t\t\t\t})
\t\t\t\t},
\t\t\t\t// 点赞效果
\t\t\t\tzan(index){
\t\t\t\t\tthis.rijiList[index].zan = !this.rijiList[index].zan;
\t\t\t\t\tif(this.rijiList[index].zan == false){
\t\t\t\t\t \tthis.rijiList[index].zan_num --;
\t\t\t\t\t \t//  获取点赞接口数据
\t\t\t\t\t\t\$.ajax({
\t\t\t\t\t\t\ttype: \"post\",
\t\t\t\t\t\t\turl: Api.base +Api.dianzan,
\t\t\t\t\t\t\tdata:{
\t\t\t\t\t\t\t\tdid:1
\t\t\t\t\t\t\t},
\t\t\t\t\t\t\tdataType: \"json\",
\t\t\t\t\t\t\tsuccess: function (data) {
\t\t\t\t\t\t\t\tconsole.log(data);
\t\t\t\t\t\t\t},
\t\t\t\t\t\t\terror: function (data) {
\t\t\t\t\t  \t\t    console.log(data);\t
\t\t\t\t\t\t\t}
\t\t\t\t\t\t});
\t\t\t\t\t}else{
\t\t\t\t\t\tthis.rijiList[index].zan_num ++;
\t\t\t\t\t}\t
\t\t\t\t}
\t\t\t}
\t\t})
\t
\t\t// 获取话题接口数据
\t\t\$.ajax({
\t\t\turl: Api.base + Api.huati,
\t\t\ttype: 'post',
\t\t\tdata:{
\t\t\t\tperiod:1
\t\t\t},
\t\t\tdataType: 'json',
\t\t\tsuccess: function (data) {
\t\t\t\tconsole.log(data.data);
\t\t\t\tvar topic_content = data.data.topic_content;
\t\t\t\tvar topic_sum_comment = data.data.topic_sum_comment;
\t\t\t\tvar topic_title = data.data.topic_title
\t\t\t\tvar editor = data.data.editor;
\t\t\t\tvar topic_logo = data.data.topic_logo;
\t\t\t\tnew Vue({
\t\t\t\t\tel: '.logo',
\t\t\t\t\tdelimiters: ['[', ']'],
\t\t\t\t\tdata: {
\t\t\t\t\t\ttopic_content: topic_content,
\t\t\t\t\t\ttopic_sum_comment: topic_sum_comment,
\t\t\t\t\t\ttopic_title: topic_title,
\t\t\t\t\t\teditor: editor,
\t\t\t\t\t\ttopic_logo: topic_logo
\t\t\t\t\t}
\t\t\t\t})

\t\t\t},
\t\t\terror: function () {
\t\t\t   console.log('获取日记列表数据失败')\t
\t\t\t}
\t\t})

\t

\t})()
function aHref(obj){
\twindow.location.href = '/diary/rijiZW.html?gid='+\$(obj).attr('attr_id');
}\t
</script>
</html>
", "html/diary/rijiDP.tpl.html", "/home/wwwroot/Paile/app/views/tpl/html/diary/rijiDP.tpl.html");
    }
}
